using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace ShopForWeb.Models
{

  /// <summary>
  /// 订单
  /// </summary>
  [Table("T_Order")]
  public class Order
  {
    [Key]
    [StringLength(32)]
    public string OrderID { get; set; } = "";
    [StringLength(200)]
    public string Addrss { get; set; } = "";
    [StringLength(11)]
    public string Phone { get; set; } = "";
    [Column(TypeName = "decimal(18,2)")]
    public decimal Price { get; set; }
    public DateTime ODate { get; set; } = DateTime.Now;
    public int OrderState { get; set; }
    public int UserID { get; set; }
    public int ManagerID { get; set; }

    [ForeignKey("UserID")]
    public virtual User? User { get; set; }
    [ForeignKey("ManagerID")]
    public virtual Manager? Manager { get; set; }
    public virtual List<OrderDetails> OwnOrderDetails { get; set; } = new List<OrderDetails>();

  }
}
